package com.ehotting.edsta.diagnosisPredict.feign.factory;

import com.ehotting.eaf.core.web.domain.diagnosisPredict.PageDto;
import com.ehotting.eaf.core.web.domain.diagnosisPredict.Response;
import com.ehotting.edsta.diagnosisPredict.domain.dto.AlgoTemplate;
import com.ehotting.edsta.diagnosisPredict.feign.AlgoTemplateFileFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * 算法模板的降级处理
 * 
 * @author edsta
 */
@Slf4j
@Component
public class AlgoTemplateFileFallbackFactory implements FallbackFactory<AlgoTemplateFileFeignService> {

    @Override
    public AlgoTemplateFileFeignService create(Throwable throwable)
    {
        log.error("算法模板调用失败:{}", throwable.getMessage());
        return new AlgoTemplateFileFeignService() {

            @Override
            public Response<PageDto<AlgoTemplate>> pageList(String algoname, String bucketDir, Integer counts, String createTime, String creater, String fileaslias, String filename, Long id, Long iteminfoId, String language, String packageaslias, String packagename, String packageurl, String purpose, String remarks, String status, String version, Long page, Long pageSize) {
                return null;
            }

            @Override
            public Response<String> deleteByIds(String ids) {
                return null;
            }

            @Override
            public Response<AlgoTemplate> getById(Long id) {
                return null;
            }
        };
    }
}
